<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>Vue修饰符与条件渲染 | 个人笔记</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../md/Vue/绑定class和style.html" />
    
    
    <link rel="prev" href="../../md/jQuery/悬停导航.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="5"
        data-chapter-title="Vue修饰符与条件渲染"
        data-filepath="md/Vue/修饰符与条件渲染.md"
        data-basepath="../.."
        data-revision="Sat Oct 13 2018 16:22:38 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="md/html/html介绍.html">
            
                
                    <a href="../../md/html/html介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        html介绍
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="md/html/html常用标签.html">
            
                
                    <a href="../../md/html/html常用标签.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        html常用标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="md/html/a标签的使用.html">
            
                
                    <a href="../../md/html/a标签的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        a标签的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="md/html/表格的介绍.html">
            
                
                    <a href="../../md/html/表格的介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        表格的介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="md/html/列表.html">
            
                
                    <a href="../../md/html/列表.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        列表
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="md/html/iframe内嵌框架.html">
            
                
                    <a href="../../md/html/iframe内嵌框架.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        iframe内嵌框架
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="md/html/表单.html">
            
                
                    <a href="../../md/html/表单.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        表单
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="md/html/媒体标签.html">
            
                
                    <a href="../../md/html/媒体标签.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        媒体标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="md/html/下拉框，多行文本域以及对齐方式.html">
            
                
                    <a href="../../md/html/下拉框，多行文本域以及对齐方式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        清除样式
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="md/css/css引入方式.html">
            
                
                    <a href="../../md/css/css引入方式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        css引入方式
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="md/css/css选择符与选择器.html">
            
                
                    <a href="../../md/css/css选择符与选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        css选择符与选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="md/css/css字体样式.html">
            
                
                    <a href="../../md/css/css字体样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        css字体样式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="md/css/图片的调整.html">
            
                
                    <a href="../../md/css/图片的调整.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        图片的调整
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="md/css/伪类选择.html">
            
                
                    <a href="../../md/css/伪类选择.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        伪类选择
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="md/css/盒子模型.html">
            
                
                    <a href="../../md/css/盒子模型.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        盒子模型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="md/css/浮动.html">
            
                
                    <a href="../../md/css/浮动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        浮动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="md/css/定位.html">
            
                
                    <a href="../../md/css/定位.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="md/css/阴影.html">
            
                
                    <a href="../../md/css/阴影.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        阴影
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="md/css/图片溢出处理.html">
            
                
                    <a href="../../md/css/图片溢出处理.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.9.</b>
                        
                        图片溢出处理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="md/css/动画.html">
            
                
                    <a href="../../md/css/动画.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.10.</b>
                        
                        动画
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.11" data-path="md/css/动画插件与浏览器内核.html">
            
                
                    <a href="../../md/css/动画插件与浏览器内核.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.11.</b>
                        
                        动画插件与浏览器内核
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.12" data-path="md/css/旋转菜单.html">
            
                
                    <a href="../../md/css/旋转菜单.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.12.</b>
                        
                        旋转菜单
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.13" data-path="md/css/视口.html">
            
                
                    <a href="../../md/css/视口.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.13.</b>
                        
                        移动端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.14" data-path="md/css/rem布局.html">
            
                
                    <a href="../../md/css/rem布局.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.14.</b>
                        
                        rem布局
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.15" data-path="md/css/权重与雪碧图.html">
            
                
                    <a href="../../md/css/权重与雪碧图.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.15.</b>
                        
                        权重问题
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.16" data-path="md/css/移动底部菜单被系统键盘顶起问题.html">
            
                
                    <a href="../../md/css/移动底部菜单被系统键盘顶起问题.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.16.</b>
                        
                        移动端导航问题
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.17" data-path="md/css/flex布局.html">
            
                
                    <a href="../../md/css/flex布局.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.17.</b>
                        
                        flex布局
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.18" data-path="md/css/fullpage的使用.html">
            
                
                    <a href="../../md/css/fullpage的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.18.</b>
                        
                        fullpage
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.19" data-path="md/css/bootstrap.html">
            
                
                    <a href="../../md/css/bootstrap.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.19.</b>
                        
                        bootstrap
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.20" data-path="md/css/媒体查询.html">
            
                
                    <a href="../../md/css/媒体查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.20.</b>
                        
                        媒体查询
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="md/js/js的介绍.html">
            
                
                    <a href="../../md/js/js的介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        JavaScript的介绍
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="md/js/JavaScript数据类型.html">
            
                
                    <a href="../../md/js/JavaScript数据类型.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        JavaScript数据类型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="md/js/数据类型的转换.html">
            
                
                    <a href="../../md/js/数据类型的转换.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        数据类型的转换
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="md/js/运算符.html">
            
                
                    <a href="../../md/js/运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="md/js/比较运算符.html">
            
                
                    <a href="../../md/js/比较运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        比较运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="md/js/赋值运算符.html">
            
                
                    <a href="../../md/js/赋值运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        赋值运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="md/js/逻辑操作符.html">
            
                
                    <a href="../../md/js/逻辑操作符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        逻辑操作符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="md/js/条件语句.html">
            
                
                    <a href="../../md/js/条件语句.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        条件语句
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="md/js/条件运算符.html">
            
                
                    <a href="../../md/js/条件运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        条件运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="md/js/位运算符.html">
            
                
                    <a href="../../md/js/位运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        位运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="md/js/循环语句.html">
            
                
                    <a href="../../md/js/循环语句.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.</b>
                        
                        循环语句
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.11" data-path="md/js/for循环.html">
            
                
                    <a href="../../md/js/for循环.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.11.</b>
                        
                        for循环
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.12" data-path="md/js/ES6.html">
            
                
                    <a href="../../md/js/ES6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.12.</b>
                        
                        ES6
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.13" data-path="md/js/es6安装.html">
            
                
                    <a href="../../md/js/es6安装.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.13.</b>
                        
                        ES6安装
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.14" data-path="md/js/内置对象.html">
            
                
                    <a href="../../md/js/内置对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.14.</b>
                        
                        内置对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.15" data-path="md/js/Array对象.html">
            
                
                    <a href="../../md/js/Array对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.15.</b>
                        
                        Array对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.16" data-path="md/js/Date对象.html">
            
                
                    <a href="../../md/js/Date对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.16.</b>
                        
                        Date对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.17" data-path="md/js/布尔值对象.html">
            
                
                    <a href="../../md/js/布尔值对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.17.</b>
                        
                        布尔值对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.18" data-path="md/js/数学对象.html">
            
                
                    <a href="../../md/js/数学对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.18.</b>
                        
                        数学对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.19" data-path="md/js/对象的创建.html">
            
                
                    <a href="../../md/js/对象的创建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.19.</b>
                        
                        对象的创建
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.20" data-path="md/js/BOM.html">
            
                
                    <a href="../../md/js/BOM.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.20.</b>
                        
                        BOM
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.21" data-path="md/js/DOM关于元素的获取.html">
            
                
                    <a href="../../md/js/DOM关于元素的获取.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.21.</b>
                        
                        DOM关于元素的获取
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.22" data-path="md/js/DOM元素对象.html">
            
                
                    <a href="../../md/js/DOM元素对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.22.</b>
                        
                        DOM元素对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.23" data-path="md/js/DOM事件练习.html">
            
                
                    <a href="../../md/js/DOM事件练习.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.23.</b>
                        
                        DOM事件练习
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.24" data-path="md/js/DOM鼠标事件.html">
            
                
                    <a href="../../md/js/DOM鼠标事件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.24.</b>
                        
                        DOM鼠标事件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.25" data-path="md/js/事件代理.html">
            
                
                    <a href="../../md/js/事件代理.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.25.</b>
                        
                        事件代理
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.26" data-path="md/js/移动端事件.html">
            
                
                    <a href="../../md/js/移动端事件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.26.</b>
                        
                        移动端事件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.27" data-path="md/js/无缝轮播图.html">
            
                
                    <a href="../../md/js/无缝轮播图.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.27.</b>
                        
                        无缝轮播图
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.28" data-path="md/js/鼠标事件练习.html">
            
                
                    <a href="../../md/js/鼠标事件练习.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.28.</b>
                        
                        鼠标事件练习
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.29" data-path="md/js/ajax.html">
            
                
                    <a href="../../md/js/ajax.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.29.</b>
                        
                        ajax
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.30" data-path="md/js/封装ajax.html">
            
                
                    <a href="../../md/js/封装ajax.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.30.</b>
                        
                        封装ajax
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.31" data-path="md/js/高德地图的使用.html">
            
                
                    <a href="../../md/js/高德地图的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.31.</b>
                        
                        高德地图的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.32" data-path="md/js/预加载插件使用.html">
            
                
                    <a href="../../md/js/预加载插件使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.32.</b>
                        
                        预加载插件使用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="md/jQuery/JQ变量的声明.html">
            
                
                    <a href="../../md/jQuery/JQ变量的声明.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        JQ变量的声明
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="md/jQuery/选择器和效果.html">
            
                
                    <a href="../../md/jQuery/选择器和效果.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        选择器和效果
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="md/jQuery/属性.html">
            
                
                    <a href="../../md/jQuery/属性.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="md/jQuery/尺寸.html">
            
                
                    <a href="../../md/jQuery/尺寸.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        尺寸
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="md/jQuery/遍历.html">
            
                
                    <a href="../../md/jQuery/遍历.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        遍历
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="md/jQuery/正则表达式.html">
            
                
                    <a href="../../md/jQuery/正则表达式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        正则表达式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="md/jQuery/jQuery事件练习.html">
            
                
                    <a href="../../md/jQuery/jQuery事件练习.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.6.</b>
                        
                        jQuery事件练习
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.7" data-path="md/jQuery/操作.html">
            
                
                    <a href="../../md/jQuery/操作.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.7.</b>
                        
                        操作
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.8" data-path="md/jQuery/事件.html">
            
                
                    <a href="../../md/jQuery/事件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.8.</b>
                        
                        事件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.9" data-path="md/jQuery/ajax.html">
            
                
                    <a href="../../md/jQuery/ajax.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.9.</b>
                        
                        ajax
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.10" data-path="md/jQuery/三级联动.html">
            
                
                    <a href="../../md/jQuery/三级联动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.10.</b>
                        
                        三级联动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.11" data-path="md/jQuery/滚动监听导航效果.html">
            
                
                    <a href="../../md/jQuery/滚动监听导航效果.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.11.</b>
                        
                        滚动监听导航效果
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.12" data-path="md/jQuery/悬停导航.html">
            
                
                    <a href="../../md/jQuery/悬停导航.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.12.</b>
                        
                        悬停导航
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="5" data-path="md/Vue/修饰符与条件渲染.html">
            
                
                    <a href="../../md/Vue/修饰符与条件渲染.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        Vue修饰符与条件渲染
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="md/Vue/绑定class和style.html">
            
                
                    <a href="../../md/Vue/绑定class和style.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        绑定class和style
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="md/Vue/排序.html">
            
                
                    <a href="../../md/Vue/排序.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        排序
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="md/Vue/表单输入绑定.html">
            
                
                    <a href="../../md/Vue/表单输入绑定.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        表单输入绑定
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="md/Vue/生命周期.html">
            
                
                    <a href="../../md/Vue/生命周期.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        生命周期
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="md/Vue/自定义指令.html">
            
                
                    <a href="../../md/Vue/自定义指令.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        自定义指令
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="md/Vue/组件.html">
            
                
                    <a href="../../md/Vue/组件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.6.</b>
                        
                        组件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.7" data-path="md/Vue/Vue事件练习.html">
            
                
                    <a href="../../md/Vue/Vue事件练习.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.7.</b>
                        
                        Vue事件练习
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8" data-path="md/Vue/动态模板.html">
            
                
                    <a href="../../md/Vue/动态模板.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.</b>
                        
                        动态模板
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.9" data-path="md/Vue/插槽的使用.html">
            
                
                    <a href="../../md/Vue/插槽的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.9.</b>
                        
                        插槽的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.10" data-path="md/Vue/router.html">
            
                
                    <a href="../../md/Vue/router.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.10.</b>
                        
                        router
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.11" data-path="md/Vue/ajax与框架搭建.html">
            
                
                    <a href="../../md/Vue/ajax与框架搭建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.11.</b>
                        
                        ajax与框架搭建
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.12" data-path="md/Vue/store.html">
            
                
                    <a href="../../md/Vue/store.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.12.</b>
                        
                        store
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.13" data-path="md/Vue/ref获取元素.html">
            
                
                    <a href="../../md/Vue/ref获取元素.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.13.</b>
                        
                        ref获取元素
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="md/wx/小程序.html">
            
                
                    <a href="../../md/wx/小程序.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        小程序
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="md/wx/封装外部ajax路径.html">
            
                
                    <a href="../../md/wx/封装外部ajax路径.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        封装外部ajax路径
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="md/wx/练习.html">
            
                
                    <a href="../../md/wx/练习.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        练习
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" data-path="md/Egret/canvas.html">
            
                
                    <a href="../../md/Egret/canvas.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        canvas
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1" data-path="md/Egret/async.html">
            
                
                    <a href="../../md/Egret/async.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.1.</b>
                        
                        async
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="md/Egret/显示对象与容器.html">
            
                
                    <a href="../../md/Egret/显示对象与容器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.2.</b>
                        
                        显示对象与容器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.3" data-path="md/Egret/01.基础.html">
            
                
                    <a href="../../md/Egret/01.基础.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.3.</b>
                        
                        01.基础
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4" data-path="md/Egret/02.对象池.html">
            
                
                    <a href="../../md/Egret/02.对象池.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.</b>
                        
                        02.对象池
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5" data-path="md/Egret/03.typeScript.html">
            
                
                    <a href="../../md/Egret/03.typeScript.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.</b>
                        
                        03.typeScript
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.6" data-path="md/Egret/04.场景管理类.html">
            
                
                    <a href="../../md/Egret/04.场景管理类.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.6.</b>
                        
                        04.场景管理类
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="8" data-path="gitbook的安装.html">
            
                
                    <a href="../../gitbook的安装.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.</b>
                        
                        gitbook的安装
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >个人笔记</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <pre><code>        &lt;style type=&quot;text/css&quot;&gt;
            html,body,.app{
                height: 100%;
            }
            .app{
                overflow-y: scroll;
            }
            .sc{
                height: 1000px;
            }
        &lt;/style&gt;
</code></pre><pre><code>        &lt;div class=&quot;app&quot;  @scroll.passive=&quot;scroll&quot;&gt;
            {{content+titl}}
            &lt;div class=&quot;test&quot; @click=&quot;test&quot;&gt;
                &#x6211;&#x662F;&#x7528;&#x6765;&#x6D4B;&#x8BD5;vue&#x4FEE;&#x9970;&#x7B26;&#x7684;
                &lt;p v-html=&quot;content&quot; @click.once=&quot;changCont(&apos;123&apos;,$event)&quot;&gt;&lt;/p&gt;
            &lt;/div&gt;
            &lt;img v-bind:src=&quot;src&quot; :title=&quot;titl&quot; alt=&quot;&quot;/&gt;
            &lt;h1 v-if=&quot;isShow&quot;&gt;&#x6211;&#x662F;h1&#x6807;&#x7B7E;&lt;/h1&gt;
            &lt;h2 v-show=&quot;isShow&quot;&gt;&#x6211;&#x662F;h2&#x6807;&#x7B7E;&lt;/h2&gt;
            &lt;ul&gt;
                &lt;li v-for=&quot;(item,index) in objList&quot;&gt;{{index}}--{{item}}&lt;/li&gt;
            &lt;/ul&gt;
            &lt;input type=&quot;text&quot; @keydown.enter=&quot;ent&quot; name=&quot;&quot; id=&quot;&quot; value=&quot;&quot; /&gt;
            &lt;div class=&quot;sc&quot;&gt;&lt;/div&gt;
        &lt;/div&gt;
    &lt;!--
        &#x8FD9;&#x4E2A;p&#x6807;&#x7B7E;&#x5728;vue&#x5B9E;&#x4F8B;&#x7684;&#x63A7;&#x5236;&#x8303;&#x56F4;&#x4E4B;&#x5916;&#xFF0C;&#x6240;&#x4EE5;&#x8FD9;{{content}}&#x662F;&#x65E0;&#x6548;&#x7684;
    &lt;p class=&quot;app2&quot;&gt;{{content}}&lt;/p&gt;
    --&gt;
</code></pre><pre><code>//            var app = document.querySelector(&quot;.app&quot;);
//            app.innerText=&quot;hello world&quot;;
</code></pre><h1 id="1&#x3001;&#x6570;&#x636E;&#x9A71;&#x52A8;&#x89C6;&#x56FE;&#x5C3D;&#x91CF;&#x51CF;&#x5C11;dom&#x64CD;&#x4F5C;">1&#x3001;&#x6570;&#x636E;&#x9A71;&#x52A8;&#x89C6;&#x56FE;(&#x5C3D;&#x91CF;&#x51CF;&#x5C11;DOM&#x64CD;&#x4F5C;)</h1>
<p>&#x600E;&#x4E48;&#x7528;</p>
<p>1&#x3001;&#x901A;&#x8FC7;new&#x5173;&#x952E;&#x8BCD;&#x5B9E;&#x4F8B;&#x5316;&#x4E00;&#x4E2A;vue&#x5BF9;&#x8C61;</p>
<p>2&#x3001;el&#x4EE3;&#x8868;&#x6211;&#x4EEC;vue&#x5B9E;&#x4F8B;&#x5BF9;&#x8C61;&#x63A7;&#x5236;&#x7684;DOM&#x5BF9;&#x8C61;&#x8303;&#x56F4;</p>
<p>&#x503C;&#x4E3A;css&#x9009;&#x62E9;&#x5668;&#x6216;&#x8005;DOM&#x5BF9;&#x8C61;</p>
<p> 3&#x3001;data:&#x7528;&#x6765;&#x5B58;&#x50A8;&#x6570;&#x636E;</p>
<p>&#x600E;&#x4E48;&#x529E;&#x6570;&#x636E;&#x6E32;&#x67D3;&#x5230;&#x9875;&#x9762;&#xFF1F;</p>
<p>1&#x3001;&#x901A;&#x8FC7;{{}}&#x7B26;&#x53F7;&#x6765;&#x63D2;&#x5165;&#x5230;&#x9875;&#x9762;(&#x53EB;&#x505A;&#x63D2;&#x503C;&#x8868;&#x8FBE;&#x5F0F;)&#xFF0C;&#x4E0D;&#x8BC6;&#x522B;&#x6807;&#x7B7E;</p>
<p>4&#x3001;methods:&#x5B9A;&#x4E49;&#x65B9;&#x6CD5;</p>
<h1 id="&#x6307;&#x4EE4;&#xFF1A;">&#x6307;&#x4EE4;&#xFF1A;</h1>
<p>v-html:&#x53EF;&#x4EE5;&#x5C06;&#x6570;&#x636E;&#x4E2D;&#x7684;&#x6807;&#x7B7E;&#x8BC6;&#x522B;&#x51FA;&#x6765;&#x3002;</p>
<p>v-bind:propertyName(&#x5C5E;&#x6027;&#x540D;) &#x7528;&#x4E8E;&#x8BBE;&#x7F6E;&#x5143;&#x7D20;&#x5C5E;&#x6027;,&#x53EF;&#x7B80;&#x5199;&#x4E3A;&#xFF1A;</p>
<p>&#x6BD4;&#x5982;&#xFF1A;v-bind:title =&gt; :title</p>
<p>v-on&#xFF1A;&#x7528;&#x6765;&#x6CE8;&#x518C;&#x4E8B;&#x4EF6;&#x76D1;&#x542C;&#xFF0C;&#x53EF;&#x7B80;&#x5199;&#x4E3A;@</p>
<p>&#x6BD4;&#x5982;v-on:click=&gt;@click</p>
<p>v-if:&#x7528;&#x4E8E;&#x5224;&#x65AD;&#x4E00;&#x4E2A;&#x7ED3;&#x6784;&#x662F;&#x5426;&#x88AB;&#x6E32;&#x67D3;&#x5230;&#x9875;&#x9762;&#xFF0C;&#x5224;&#x65AD;&#x6761;&#x4EF6;&#x4E3A;true&#x4E3A;&#x6E32;&#x67D3;&#xFF0C;false&#x4E0D;&#x6E32;&#x67D3;</p>
<p>v-else:&#x8981;&#x914D;&#x5408;v-if&#x4F7F;&#x7528;</p>
<p> v-else-if:&#x76F8;&#x5F53;&#x4E8E;&#x539F;&#x751F;js&#x7684;else if</p>
<p>v-show:&#x5224;&#x65AD;&#x4E00;&#x4E2A;&#x7ED3;&#x6784;&#x662F;&#x5426;&#x663E;&#x793A;&#x5728;&#x9875;&#x9762;&#x4E0A;&#xFF0C;&#x901A;&#x8FC7;&#x63A7;&#x5236;css&#x7684;display&#x5C5E;&#x6027;&#x6765;&#x63A7;&#x5236;&#x5185;&#x5BB9;&#x7684;&#x663E;&#x793A;&#x9690;&#x85CF;</p>
<p>&#x800C;v-if&#x662F;&#x76F4;&#x63A5;&#x79FB;&#x9664;&#x6216;&#x63D2;&#x5165;&#x5185;&#x5BB9;&#x6765;&#x8FBE;&#x5230;&#x663E;&#x793A;&#x9690;&#x85CF;&#x7684;&#x6548;&#x679C;&#x3002;</p>
<p>v-for:&#x5FAA;&#x73AF;&#x6570;&#x7EC4;&#x6216;&#x5BF9;&#x8C61;</p>
<p>&#x6BD4;&#x5982;&#xFF1A; v-for=&quot;item in list&quot;</p>
<p>&#x8868;&#x793A;&#x5FAA;&#x73AF;list&#x6570;&#x7EC4;&#xFF0C;&#x5E76;&#x5C06;&#x6570;&#x7EC4;&#x91CC;&#x9762;&#x7684;&#x6BCF;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#x8D4B;&#x503C;&#x7ED9;item</p>
<p>v-for=&quot;(item,index) in list&quot;</p>
<p>&#x5C0F;&#x62EC;&#x53F7;&#x91CC;&#x9762;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x503C;&#x4EE3;&#x8868;&#x6570;&#x7EC4;&#x91CC;&#x9762;&#x7684;&#x5143;&#x7D20;</p>
<p>&#x7B2C;&#x4E8C;&#x4E2A;&#x503C;&#x4EE3;&#x8868;&#x6570;&#x7EC4;&#x91CC;&#x9762;&#x7684;&#x4E0B;&#x6807;</p>
<h1 id="&#x4FEE;&#x9970;&#x7B26;">&#x4FEE;&#x9970;&#x7B26;</h1>
<p>.stop:&#x963B;&#x6B62;&#x4E8B;&#x4EF6;&#x5192;&#x6CE1;</p>
<p>.prevent:&#x963B;&#x6B62;&#x9ED8;&#x8BA4;&#x4E8B;&#x4EF6;</p>
<p>.capture:&#x66F4;&#x6539;&#x4E8B;&#x4EF6;&#x4F20;&#x9012;&#x8FC7;&#x7A0B;&#x4E3A;&#x4E8B;&#x4EF6;&#x6355;&#x83B7;&#x3002;</p>
<p>.self:&#x963B;&#x6B62;&#x81EA;&#x8EAB;&#x7684;&#x70B9;&#x51FB;&#x4E8B;&#x4EF6;</p>
<p>.once:&#x4E00;&#x6B21;&#x4E8B;&#x4EF6;</p>
<p>.passive &#x4FEE;&#x9970;&#x7B26;&#x5C24;&#x5176;&#x80FD;&#x591F;&#x63D0;&#x5347;&#x79FB;&#x52A8;&#x7AEF;&#x7684;&#x6027;&#x80FD;</p>
<h1 id="&#x6309;&#x952E;&#x4FEE;&#x9970;&#x7B26;">&#x6309;&#x952E;&#x4FEE;&#x9970;&#x7B26;</h1>
<p>.enter</p>
<p>.tab</p>
<p>.esc</p>
<p>.exact,&#x7CBE;&#x786E;&#x89E6;&#x53D1;&#x6307;&#x5B9A;&#x7684;&#x4E00;&#x4E2A;&#x4E8B;&#x4EF6;</p>
<p>&#x5728;vue&#x4E2D;this&#x7684;&#x6307;&#x5411;&#x59CB;&#x7EC8;&#x6307;&#x5411;vue&#x5B9E;&#x4F8B;&#x5BF9;&#x8C61;&#xFF0C;&#x9664;&#x975E;&#x624B;&#x52A8;&#x66F4;&#x6539;</p>
<p> vue&#x4E2D;&#x540C;&#x6837;&#x6709;&#x4E8B;&#x4EF6;&#x5BF9;&#x8C61;</p>
<p>1&#x3001;&#x5982;&#x679C;&#x8C03;&#x7528;&#x51FD;&#x6570;&#x6CA1;&#x6709;&#x4F20;&#x53C2;&#xFF0C;&#x5219;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x4F7F;&#x7528;&#x4E8B;&#x4EF6;&#x5BF9;&#x8C61;</p>
<p>2&#x3001;&#x5982;&#x679C;&#x8C03;&#x7528;&#x51FD;&#x6570;&#x6709;&#x4F20;&#x53C2;&#xFF0C;&#x90A3;&#x4E48;&#x4E8B;&#x4EF6;&#x5BF9;&#x8C61;&#x9700;&#x8981;&#x901A;&#x8FC7;$event&#x6765;&#x4F20;&#x5165;</p>
<p> &#x539F;&#x751F;&#x66F4;&#x6539;&#x4E8B;&#x4EF6;&#x4F20;&#x9012;&#x8FC7;&#x7A0B;&#x4E3A;&#x4E8B;&#x4EF6;&#x6355;&#x83B7;</p>
<p> addeEVentListener(eventType,callback,bool)</p>
<p> bool:&#x7528;&#x4E8E;&#x8BBE;&#x7F6E;&#x4E8B;&#x4EF6;&#x4F20;&#x9012;&#x8FC7;&#x7A0B;&#xFF0C;&#x503C;&#x4E3A;true&#xFF0C;&#x5219;&#x4E8B;&#x4EF6;&#x6355;&#x83B7;</p>
<p>false&#xFF1A;&#x4E8B;&#x4EF6;&#x5192;&#x6CE1;</p>
<pre><code>            var vm = new Vue({
                el:&quot;.app&quot;,
                data:{
                    content:&quot;&lt;b&gt;hello world&lt;/b&gt;&quot;,//content&#x81EA;&#x5B9A;&#x4E49;&#x7684;&#x540D;&#x79F0;
                    src:&quot;img/youxi-11.png&quot;,
                    titl:&quot;&#x6211;&#x662F;&#x4E00;&#x4E2A;&#x53EF;&#x7231;&#x7684;&#x4EBA;&quot;,
                    isShow:false,
                    list:[
                        &quot;123456&quot;,
                        &quot;6789&quot;
                    ],
                    objList:{
                        &quot;name&quot;:&quot;&#x5C0F;&#x660E;&quot;,
                        &quot;sex&quot;:&quot;nan&quot;,
                        &quot;age&quot;:&quot;18&quot;
                    }
                },
                methods:{
                    changCont:function(index,e){
                        this.content=&quot;goodbye world!&quot;;
                        this.isShow =true;
                        console.log(this);
                        console.log(e.target);//&lt;b&gt;hello world&lt;/b&gt;
                        console.log(e);
                        console.log(index);//123
                        alert(&quot;&#x6211;&#x662F;&#x5B50;&#x5143;&#x7D20;&#x91CC;&#x9762;&#x7684;&#x70B9;&#x51FB;&#x4E8B;&#x4EF6;&quot;)
                    },
                    test:function(){
                        alert(&quot;&#x6211;&#x662F;&#x7236;&#x7EA7;&#x5143;&#x7D20;&#x7684;&#x70B9;&#x51FB;&#x4E8B;&#x4EF6;&quot;)
                    },
                    scroll:function(){
                        console.log(111)
                    },
                    ent:function(){
                        console.log(&quot;&#x4F60;&#x6309;&#x4E0B;&#x4E86;enter&#x952E;&quot;)
                    }
                }
            })
            /*setTimeout(function(){
                vm.content = &quot;goodbye world&quot;;
            },1000)*/
</code></pre><h1 id="&#x5217;&#x8868;&#x6E32;&#x67D3;">&#x5217;&#x8868;&#x6E32;&#x67D3;</h1>
<p> v-for</p>
<p>key&#x503C;&#x7684;&#x4F5C;&#x7528;</p>
<p>1&#x3001;&#x9AD8;&#x6548;&#x7684;&#x6E32;&#x67D3;&#x865A;&#x62DF;DOM</p>
<p>2&#x3001;&#x53E6;&#x5916;vue&#x4E2D;&#x4F7F;&#x7528;&#x76F8;&#x540C;&#x6807;&#x7B7E;&#x540D;&#x5143;&#x7D20;&#x7684;&#x8FC7;&#x6E21;&#x5207;&#x6362;&#x65F6;&#xFF0C;&#x4E5F;&#x4F1A;&#x4F7F;&#x7528;&#x5230;key&#x5C5E;&#x6027;&#xFF0C;&#x5176;&#x76EE;&#x7684;&#x4E5F;&#x662F;&#x4E3A;&#x4E86;&#x8BA9;vue&#x53EF;&#x4EE5;&#x533A;&#x5206;&#x5B83;&#x4EEC;</p>
<pre><code>        &lt;div class=&quot;app&quot;&gt;
            &lt;!--&#x4E0B;&#x9762;&#x4F8B;&#x5B50;&#x8868;&#x793A;&#xFF1A;&#x5982;&#x679C;isShow&#x4E3A;true&#x5219;&#x663E;&#x793A;&#x63D0;&#x4EA4;&#x6309;&#x94AE;--&gt;
            &lt;!--&#x5426;&#x5219;&#x663E;&#x793A;&#x786E;&#x5B9A;&#x6309;&#x94AE;--&gt;
            &lt;button v-if=&quot;isShow&quot;&gt;&#x63D0;&#x4EA4;&lt;/button&gt;
            &lt;button V-else @click=&quot;conf&quot;&gt;&#x786E;&#x5B9A;&lt;/button&gt;
            &lt;p v-if=&quot;type==&apos;A&apos;&quot;&gt;A&lt;/p&gt;
            &lt;p v-else-if=&quot;type==&apos;B&apos;&quot;&gt;B&lt;/p&gt;
            &lt;!--&lt;p v-else&gt; on a and b&lt;/p&gt;--&gt;
            &lt;p v-else&gt;type:{{type}}&lt;/p&gt;
            &lt;ul&gt;
                &lt;li v-for=&quot;(item,index) in list&quot; :key=&quot;item&quot; @click=&quot;changCont&quot;&gt;{{item}}&lt;/li&gt;
            &lt;/ul&gt;
            &lt;ul&gt;
                &lt;li v-for=&quot;(item,index) in newlist&quot; :key=&quot;item.id&quot;&gt;{{item.name}}&lt;/li&gt;
            &lt;/ul&gt;
        &lt;/div&gt;
</code></pre><pre><code>            var vm =new Vue({
                el:&quot;.app&quot;,
                data:{
                    isShow:false,
//                    type:&quot;A&quot;
                    type:&quot;111&quot;,
                    list:[
                        &quot;html&#x662F;&#x8D85;&#x6587;&#x672C;&#x6807;&#x8BB0;&#x8BED;&#x8A00;&quot;,
                        &quot;css&#x662F;&#x5C42;&#x53E0;&#x6837;&#x5F0F;&#x8868;&quot;
                    ],
                    newlist:[
                        {&quot;id&quot;:1,&quot;name&quot;:&quot;bgg&quot;},
                        {&quot;id&quot;:2,&quot;name&quot;:&quot;css&quot;}
                    ]
                },
                methods:{
                    conf:function(){
                        this.isShow = true
                    },
                    changCont:function(){
                        /**
                         * &#x5F53;&#x6211;&#x4EEC;&#x901A;&#x8FC7;&#x6570;&#x7EC4;&#x4E0B;&#x6807;&#x503C;&#x6765;&#x6539;&#x53D8;&#x5185;&#x5BB9;&#x7684;&#x8BDD;&#xFF0C;&#x662F;&#x4E0D;&#x4F1A;&#x89E6;&#x53D1;&#x89C6;&#x56FE;&#x66F4;&#x65B0;
                         * &#x4F1A;&#x89E6;&#x53D1;&#x89C6;&#x56FE;&#x66F4;&#x65B0;&#x7684;&#x6709;&#x4EE5;&#x4E0B;&#x51E0;&#x79CD;&#x65B9;&#x6CD5;
                         * 1&#x3001;splice(index,len,[item])&#x5B83;&#x4E5F;&#x53EF;&#x4EE5;&#x7528;&#x6765;&#x66FF;&#x6362;/&#x5220;&#x9664;/&#x6DFB;&#x52A0;&#x6570;&#x7EC4;&#x5185;&#x67D0;&#x4E00;&#x4E2A;&#x6216;&#x8005;&#x51E0;&#x4E2A;&#x503C;&#xFF08;&#x8BE5;&#x65B9;&#x6CD5;&#x4F1A;&#x6539;&#x53D8;&#x539F;&#x59CB;&#x6570;&#x7EC4;&#xFF09;
                         * 2&#x3001;push()
                         * 3&#x3001;pop()&#x5220;&#x9664;&#x6700;&#x540E;&#x4E00;&#x4E2A;
                         * 4&#x3001;shift()&#x5220;&#x9664;&#x6700;&#x524D;&#x4E00;&#x4E2A;
                         * 5&#x3001;unshift()&#x65B9;&#x6CD5;&#x53EF;&#x5411;&#x6570;&#x7EC4;&#x7684;&#x5F00;&#x5934;&#x6DFB;&#x52A0;&#x4E00;&#x4E2A;&#x6216;&#x66F4;&#x591A;&#x5143;&#x7D20;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x65B0;&#x7684;&#x957F;&#x5EA6;&#x3002;
                         * 6&#x3001;sort()
                         * 7&#x3001;reverse()&#x5012;&#x5E8F;
                         * */
                        console.log(this.list[0]);
                        this.list[0] = &quot;JavaScript&quot;;
                        this.list.splice(0,1,&quot;JavaScript&quot;)
                    }
                }
            })
</code></pre><p>v-for</p>
<p>1&#x3001;&#x5FAA;&#x73AF;&#x6570;&#x7EC4;</p>
<p>2&#x3001;&#x5FAA;&#x73AF;&#x5BF9;&#x8C61;</p>
<p>v-for=&quot;(val,name,index) in obj&quot;</p>
<p>val:&#x8868;&#x793A;&#x5BF9;&#x8C61;&#x7684;&#x5C5E;&#x6027;&#x503C;</p>
<p>name&#xFF1A;&#x8868;&#x793A;&#x5BF9;&#x8C61;&#x7684;&#x5C5E;&#x6027;&#x540D;</p>
<p>index&#xFF1A;&#x6BCF;&#x4E2A;&#x5BF9;&#x8C61;&#x7684;&#x5C5E;&#x6027;&#x5BF9;&#x5E94;&#x7684;&#x4E0B;&#x6807;&#x503C;</p>
<p>3&#x3001;&#x5FAA;&#x73AF;&#x6570;&#x5B57;</p>
<p>v-for=&quot;num in 10&quot;</p>
<p>&#x8868;&#x793A;&#x5FAA;&#x73AF;10&#x8FD9;&#x4E2A;&#x6570;&#x5B57;&#xFF0C;&#x5E76;&#x5C06;&#x4E00;&#x5230;&#x5341;&#x6BCF;&#x4E00;&#x4E2A;&#x6570;&#x503C;&#x8D4B;&#x503C;&#x7ED9;num</p>
<pre><code>        &lt;div class=&quot;app&quot; v-cloak&gt;
            &lt;ul&gt;
                &lt;li v-for=&quot;(val,name,index) in obj&quot;&gt;{{index}}---{{name}}---{{val}}&lt;/li&gt;
            &lt;/ul&gt;
            &lt;p v-for=&quot;num in 10&quot;&gt;{{num}}&lt;/p&gt;
            &lt;ul&gt;
                &lt;li v-for=&quot;item in arr&quot; @click=&quot;changeCont&quot;&gt;{{item}}&lt;/li&gt;
            &lt;/ul&gt;
        &lt;/div&gt;
</code></pre><pre><code>            new Vue({
                el:&quot;.app&quot;,
                data:{
                    obj:{
                        &quot;name&quot;:&quot;&#x5C0F;&#x660E;&quot;,
                        &quot;age&quot;:&quot;15&quot;,
                        &quot;sex&quot;:&quot;&#x7537;&quot;,
                        &quot;&#x7231;&#x597D;&quot;:&quot;&#x5973;&quot;
                    },
                    arr:[&quot;html&quot;,&quot;css&quot;,&quot;JavaScript&quot;]
                },
                methods:{
                    //es6&#x8BED;&#x6CD5;&#xFF0C;&#x76F8;&#x5F53;&#x4E8E;changeCont:function(){}
                    changeCont(){
                        //this.arr[0]=&quot;java&quot;;
                        /**
                         * &#x901A;&#x8FC7;set&#x65B9;&#x6CD5;&#x6765;&#x8BBE;&#x7F6E;&#x6570;&#x7EC4;&#x5185;&#x5BB9;&#x53EF;&#x4EE5;&#x89E6;&#x53D1;&#x89C6;&#x56FE;&#x66F4;&#x65B0;
                         * &#x6709;&#x4EE5;&#x4E0B;&#x4E24;&#x79CD;&#x5199;&#x6CD5;
                         * this.$set(add/obj,index/name,&#x66F4;&#x6539;&#x540E;&#x7684;&#x5185;&#x5BB9;)
                         * vue.set(add/obj,index/name,&#x66F4;&#x6539;&#x540E;&#x7684;&#x5185;&#x5BB9;)
                         * arr/obj&#xFF1A;&#x8868;&#x793A;&#x9700;&#x8981;&#x66F4;&#x6539;&#x7684;&#x6570;&#x7EC4;&#x6216;&#x8005;&#x5BF9;&#x8C61;
                         * index/name&#xFF1A;&#x8868;&#x793A;&#x9700;&#x8981;&#x66F4;&#x6539;&#x7684;&#x6570;&#x7EC4;&#x6216;&#x5BF9;&#x8C61;&#x91CC;&#x9762;&#x5177;&#x4F53;&#x54EA;&#x4E2A;&#x5143;&#x7D20;&#x6216;&#x8005;&#x5C5E;&#x6027;
                         * */
                        //this.$set(this.arr,0,&quot;java&quot;);
                        Vue.set(this.arr,0,&quot;java&quot;);
                    }
                }
            })
</code></pre>
                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../md/jQuery/悬停导航.html" class="navigation navigation-prev " aria-label="Previous page: 悬停导航"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../md/Vue/绑定class和style.html" class="navigation navigation-next " aria-label="Next page: 绑定class和style"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
